// function* foo(x){
//     const a=1+2
//     return a 

// }
// const it=foo(5)
// console.log(it.next())


function* foo(x){
    let y=2*(yield(x+1))
    let z=yield(y/3)
    return(x+y+z)
}
const it=foo(5)
console.log(it.next()) //{ value: 6, done: false }
console.log(it.next(6))
console.log(it.next(4))